Skip to content

Conversation

@Ansonhkg
Copy link
Collaborator

WHAT

When calling the contractClient.pkpNftContractUtils.read.getTokensInfoByAddress function, tokenId is returning undefined. This little fix added a check to ensure addrs.tokenId is assigned a value if it’s missing. If the derivedAddresses function doesn’t return a tokenId, the tokenId from the context (tokenId) is used as a fallback.

const tokenId = tokenIds[i];
const pubKey = await this.pkpNftContract.read.getPubkey(tokenId);
const addrs = await derivedAddresses({
const addrs: TokenInfo = await derivedAddresses({
Copy link
Contributor

@FedericoAmura FedericoAmura Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should make the tokenId optional in TokenInfo to keep Typescript consistency. This way we can also remove the any in derivedAddresses return type TokenInfo | any

@Ansonhkg Ansonhkg merged commit a76688b into master Dec 23, 2024
5 checks passed
@Ansonhkg Ansonhkg deleted the feature/drel-378-tg-osmosis-team-facing-issues-with-sdk-utility-method branch December 23, 2024 22:00
@Ansonhkg Ansonhkg mentioned this pull request Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants